- Posts: 44
- Thank you received: 6
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Solved: Date format for {VALIDUNTIL} - use {date('...',strtotime(VALIDUNTIL))}
- Indispirit
- Topic Author
- Offline
- Senior Member
Less
More
4 years 7 months ago #188862
by Indispirit
Date format for {VALIDUNTIL} was created by Indispirit
Hi all
Are there any expressions I can use to format the out put of date fields such as {VALIDUNTIL} and {VALIDFROM}?
For example, the raw output is: 2019-12-18 11:38:00
We'd like to format as: 18 December.
If some detail is available I could have a go at updating the wiki.
Are there any expressions I can use to format the out put of date fields such as {VALIDUNTIL} and {VALIDFROM}?
For example, the raw output is: 2019-12-18 11:38:00
We'd like to format as: 18 December.
If some detail is available I could have a go at updating the wiki.
The topic has been locked.
- Indispirit
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 6
4 years 7 months ago #188889
by Indispirit
Replied by Indispirit on topic Date format for {VALIDUNTIL}
I've been trying:
{date_format(VALIDUNTIL, 'd F Y')}
but this returns a blank. I was using the information at www.w3schools.com/PHP/func_date_date_format.asp
..but is there somewhere else for a full list of supported expressios I should be looking?
The validate expression function in the email templates seems to suggest date_format is supported.
{date_format(VALIDUNTIL, 'd F Y')}
but this returns a blank. I was using the information at www.w3schools.com/PHP/func_date_date_format.asp
..but is there somewhere else for a full list of supported expressios I should be looking?
The validate expression function in the email templates seems to suggest date_format is supported.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
4 years 7 months ago - 4 years 7 months ago #188901
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Date format for {VALIDUNTIL}
Expression didn't have date_format function.
But you can use date and strtotime function
Try
{date('d F Y',strtotime(VALIDUNTIL))}
PS: VALIDUNTIL or VALIDFROM variables can be used only in email template
But you can use date and strtotime function
Try
{date('d F Y',strtotime(VALIDUNTIL))}
PS: VALIDUNTIL or VALIDFROM variables can be used only in email template
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 4 years 7 months ago by DenisChenu. Reason: close bracket
The following user(s) said Thank You: Indispirit
The topic has been locked.
- Indispirit
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 6
4 years 7 months ago #188943
by Indispirit
Replied by Indispirit on topic Solved: Date format for {VALIDUNTIL} - use {date('...',strtotime(VALIDUNTIL))}
Thanks Dennis, worked like a charm.
Is there an alphabetical list of all the functions available anywhere? I think even a raw list of alphabetical of entries people could cross reference with online PHP manuals we be very helpful.
For example, in our case, there is some coding we've done in Java in the question section that we could probably shift to PHP if we knew the full functionality available.
Cheers!
Is there an alphabetical list of all the functions available anywhere? I think even a raw list of alphabetical of entries people could cross reference with online PHP manuals we be very helpful.
For example, in our case, there is some coding we've done in Java in the question section that we could probably shift to PHP if we knew the full functionality available.
Cheers!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
4 years 7 months ago #188945
by DenisChenu
Else : we have on inside LimeSUrvey, but since UI is broken and whole are not testes, show in the menu only with debug >2
=> You can put a feature request to to have it somewhere in LimeSurvey admin UI
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Solved: Date format for {VALIDUNTIL} - use {date('...',strtotime(VALIDUNTIL))}
If you click on the link of my previous post : manual.limesurvey.org/Expression_Manager#Access_to_FunctionsIndispirit wrote: Is there an alphabetical list of all the functions available anywhere? I think even a raw list of alphabetical of entries people could cross reference with online PHP manuals we be very helpful.
Else : we have on inside LimeSUrvey, but since UI is broken and whole are not testes, show in the menu only with debug >2
=> You can put a feature request to to have it somewhere in LimeSurvey admin UI
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: Indispirit
The topic has been locked.
- Indispirit
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 44
- Thank you received: 6
4 years 7 months ago #188946
by Indispirit
Replied by Indispirit on topic Solved: Date format for {VALIDUNTIL} - use {date('...',strtotime(VALIDUNTIL))}
Thanks - can see dateformat is on the "Functions that are Planned or Being Considered" list too.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
4 years 7 months ago #189016
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Solved: Date format for {VALIDUNTIL} - use {date('...',strtotime(VALIDUNTIL))}
Well, in LS4 Denis did some coding to expose PHP functions more easily to ExpressionScript (ExpressionManager). That will bring new life to the "Functions that are planned or being considered".Indispirit wrote: Thanks - can see dateformat is on the "Functions that are Planned or Being Considered" list too.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu, Indispirit
The topic has been locked.